
#ifndef __RATE_COUNT_H
#define __RATE_COUNT_H

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

struct RateCount;

struct RateCount * RateCountInit(uint64_t msSamplePeriod, int32_t nSampleCapacity);

void RateCountDestroy(struct RateCount * pRate);


void RateCountReset(struct RateCount * pRate);

void SampleInsert(struct RateCount * pRate, int64_t nSample);

double GetTmpRate(struct RateCount * pRate);

int64_t GetTotalCount(struct RateCount * pRate);


uint64_t GetTotalTime(struct RateCount * pRate);

#ifdef __cplusplus
}
#endif

#endif //__RATE_COUNT_H

